interface Interface01{
    void method();
}

class Hello implements Interface01{//专门创建的类
    @Override
    public void method(){
        System.out.println("Hello!");
    }
}
public class niming {
    public static void main1(String[] args) {
        Interface01 interface01 = new Interface01() {//这就是匿名内部类
            @Override
            public void method() {
                System.out.println("niming::Hello!");
            }
        };
        interface01.method();
    }
    public static void main(String[] args) {
        new Interface01() {//这就是匿名内部类
            @Override
            public void method() {
                System.out.println("niming::Hello!");
            }
        }.method();
    }
}
